# Copyright (c) 2022 Presto Labs Pte. Ltd.
# Author: gekim

from presto_labs_client import PrestoLabsClient, Channel
import pandas as pd

def main():
  presto_labs_client = PrestoLabsClient()
  messages = presto_labs_client.replay(
    mea="Spot.Binance.v1",
    from_date="2022-10-20",
    to_date="2022-10-20",
    filters=[
      # 'trades', 'incremental_book_L2', 'book_snapshot_25', 'quotes', 'liquidations'
      Channel(name="trades", symbols=["BTC-USDT", "ETH-BUSD"]),
      ]
  )

  # for message in messages:
  #   print(message)
  with open("btc_eth_trade.txt", 'w') as f:
    for message in messages:
      f.write("{" + message + '\n')

if __name__ == '__main__':
  main()
